package com.agileboot.common.utils;

import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

public class DeepBeanUtil<E> {

    public List<E> beanCopyList(List<T> list,Object e){
        List<E> res = new ArrayList<>();
        if (!CollectionUtils.isEmpty(list)){
            for (T t : list) {
                Object medicine = new Object();
                BeanUtils.copyProperties(t,medicine);
                res.add((E) medicine);
            }
        }
        return res;
    }

}
